![]() |
PATH![]() |
![]() ![]() |
Close is an application command that requests the closing of one or more objects, usually application windows or documents.
tell application "AppleWorks"
close front window saving in file "Hard Disk:Documents:Report"¬
saving yes
end tell
tell application "Finder"
close front window
end tell
To specify the name ( nameString ) of a file in which to save the object, use a string of the form " Disk : Folder1 : Folder2 :...: Filename " ; for details, see References to Files. You can also specify a string with only a filename (" Filename "). In this case, the application attempts to find the file in the current directory. If it can't find the specified file, the application creates a file with the specified name in the current directory or, if the name includes a path, then in the directory specified by the path. (The current directory is typically the directory where the application was launched, the directory where the application last opened or saved a previous document, or another directory specified by the application. The current directory may be affected by settings in the General Controls control panel.)
The Close command will typically only save a file if it is "dirty" (has been modified since it was last saved). When the save option is ask , the Close command asks, for each modified document, whether to save the document. Depending on how an the application implements the Close command, the command may save over an existing file with the same name as the specified file without asking.